package edu.spec.lyq.week08.class1.book.unit4.one;

/**
 * \* User: lyq
 * \* Date: 2018/10/16
 * \* Time: 10:04
 * \* Description:
 */
public class Circle {
    private double Radius;  //存放圆的半径
    //将半径设为0
    public Circle(){
        this.Radius = 0;
    }
    //创建Circle对象时将半径初始化为r
    public Circle(double r){
        this.Radius = r;
    }
    //获取圆的面积
    public  double getArea() {
        return 3.14*Radius*Radius;
    }
    //获取圆的周长
    public  double getPerimeter(){
        return 2*3.14*Radius;
    }
    //将圆的半径、周长、面积输出到屏幕
    public  void show(){
        System.out.println("半径: " + this.Radius + "面积: " + this.getArea() + "周长: " + this.getPerimeter());
    }

}
